package com.jic.market.api.manage;

import com.jic.common.base.vo.PageResult;
import com.jic.common.base.vo.RestResult;
import com.jic.market.request.*;
import com.jic.market.request.manager.base.MerchantDeleteRequest;
import com.jic.market.request.manager.base.PromotionIdRequest;
import com.jic.market.request.manager.base.StoreDeleteRequest;
import com.jic.market.request.manager.coupon.*;
import com.jic.market.request.manager.skill.SkillBatchDeleteRequest;
import com.jic.market.request.rest.coupon.SendCouponRequest;
import com.jic.market.response.CouponConfigQueryResponse;
import com.jic.market.response.CouponDetailNoPageResponse;
import com.jic.market.response.CouponDetailResponse;
import com.jic.market.response.CouponNumAndGrouponNumResponse;
import com.jic.market.response.manager.base.BaseActivityResponse;
import com.jic.market.response.manager.coupon.CouponCountResponse;
import com.jic.market.response.manager.coupon.CouponGoodsQueryResponse;
import com.jic.market.response.manager.coupon.CouponMerchantResponse;
import com.jic.market.response.manager.coupon.CouponStoreResponse;
import com.jic.market.response.manager.coupon.CouponTriggerQueryResponse;
import com.jic.market.response.manager.skill.SkillGoodsQueryResponse;
import com.jic.market.response.manager.skill.SkillStoreResponse;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;
import java.util.Map;

/**
 * @author: gaolanyu
 * @date: 2020-01-09
 * @remark: 优惠券后台管理系统的服务接口
 *
 * feignClient  使用方法:
 *
 * 1.服务提供者编写 FeignClient 属性 name对应注册中心服务Id path为统一前缀  url可以直接指定调用地址（调试用）
 * 2.客户端需要在启动类上加上@EnableFeignClients注解 3.如果通过feignClient调用超时，请设置 ribbon: ReadTimeout: 3000
 * ConnectTimeout: 3000 4.客户端依赖该jic-feign-common,在调用处@Resource注解注入 即可调用
 */
@FeignClient(name = "jic-market", path = "/coupon")
public interface CouponManangeApi {

    @PostMapping("/query-detail")
    RestResult<PageResult<CouponDetailResponse>> queryCouponDetail(@RequestBody CouponDetailRequest couponDetailRequest);

    @PostMapping("/delete-coupon-detail")
    RestResult<Boolean> deleteCouponDetail(@RequestBody PromotionIdRequest promotionIdRequest);

    @PostMapping("/query-config-page")
    RestResult<PageResult<CouponConfigQueryResponse>> queryCouponConfigPage(@RequestBody CouponConfigQueryRequest request);

    @PostMapping("/query-config-by-promotion-id")
    RestResult<CouponConfigQueryResponse> queryCouponConfig(@RequestBody PromotionIdRequest promotionIdRequest);

    @PostMapping("/add-config")
    RestResult<String> addCouponConfig(@RequestBody CouponConfigAddRequest couponConfigAddRequest);

    @PostMapping("/update-config")
    RestResult<Boolean> updateCouponConfig(@RequestBody CouponConfigUpdateRequest couponConfigUpdateRequest);

    @PostMapping("/copy-config")
    RestResult<String> copyCouponConfig(@RequestBody PromotionIdRequest promotionIdRequest);

    @PostMapping("/close-config")
    RestResult<Boolean> closeCouponConfig(@RequestBody PromotionIdRequest promotionIdRequest);

    @PostMapping("/delete-config")
    RestResult<Boolean> deleteCouponConfig(@RequestBody PromotionIdRequest promotionIdRequest);

    @PostMapping("/add-merchant")
    RestResult<Boolean> addCouponMerchantConfig(@RequestBody CouponMerchantAddRequest couponMerchantAddRequest);

    @PostMapping("/query-merchant")
    RestResult<CouponMerchantResponse> queryCouponMerchant(@RequestBody CouponDetailRequest promotionIdRequest);

    @PostMapping("/delete-merchant")
    RestResult<Boolean> deleteCouponMerchant(@RequestBody MerchantDeleteRequest merchantDeleteRequest);

    @PostMapping("/add-store")
    RestResult<Boolean> addCouponStoreConfig(@RequestBody CouponStoreAddRequest couponStoreAddRequest);

    @PostMapping("/query-store")
    RestResult<CouponStoreResponse> queryCouponStore(@RequestBody CouponDetailRequest promotionIdRequest);

    @PostMapping("/delete-store")
    RestResult<Boolean> deleteCouponStore(@RequestBody StoreDeleteRequest storeDeleteRequest);

    @PostMapping("/add-goods")
    RestResult<Boolean> addGoodsLimit(@RequestBody CouponGoodsLimitIdsAddRequest couponGoodsLimitAddRequest);

    @PostMapping("/add-all-goods")
    RestResult<Boolean> addAllGoods(@RequestBody CouponGoodsLimitIdsAddRequest couponGoodsLimitAddRequest);

    @PostMapping("/update-goods")
    RestResult<Boolean> updateGoodsLimit(@RequestBody CouponGoodsLimitAddRequest couponGoodsLimitAddRequest);

    @PostMapping("/query-goods")
    RestResult<CouponGoodsQueryResponse> queryGoodsId(@RequestBody PromotionIdRequest promotionIdRequest);

    @PostMapping("/delete-goods")
    RestResult<Boolean> deleteCouponGoods(@RequestBody CouponGoodsDeleteRequest couponGoodsDeleteRequest);

    @PostMapping("/delete-batch-goods")
    RestResult<Boolean> deleteBatchGoods(@RequestBody CouponBatchDeleteRequest couponBatchDeleteRequest);

    @PostMapping("/add-trigger")
    RestResult<Boolean> addTriggerLimit(@RequestBody CouponTriggerLimitAddRequest couponTriggerLimitAddRequest);

    @PostMapping("/update-trigger")
    RestResult<Boolean> updateTriggerLimit(@RequestBody CouponTriggerLimitAddRequest couponTriggerLimitAddRequest);

    @PostMapping("/query-trigger")
    RestResult<CouponTriggerQueryResponse> queryTrigger(@RequestBody PromotionIdRequest promotionIdRequest);

    @PostMapping("/grant")
    RestResult<Boolean> grantCoupon(@RequestBody CouponGrantRequest couponGrantRequest);

    @PostMapping("/check-coupon")
    RestResult<Boolean> checkCoupon(@RequestBody CouponCheckRequest couponCheckRequest);

    @PostMapping("/save-template")
    RestResult<String> saveTemplate(@RequestBody CouponTemplatRequest couponTemplatRequest);

    @PostMapping("/query-count")
    RestResult<PageResult<CouponCountResponse>> queryCouponCount(@RequestBody CouponCountRequest couponCountRequest);

    @PostMapping("/getMerchantIdsByPromotionId")
    RestResult<List<Long>> getMerchantIdsByPromotionId(@RequestBody PromotionIdRequest promotionIdRequest);

    @PostMapping("/getStoreIdsByPromotionId")
    RestResult<List<Long>> getStoreIdsByPromotionId(@RequestBody PromotionIdRequest promotionIdRequest);

    @PostMapping("/getCouponStoreIdsByPromotionId")
    RestResult<List<Long>> getCouponStoreIdsByPromotionId(@RequestBody PromotionIdRequest promotionIdRequest);

    @PostMapping("/queryRedGoodsByPromotionId")
    RestResult<CouponGoodsQueryResponse> queryRedGoodsByPromotionId(@RequestBody PromotionIdRequest promotionIdRequest);

    @PostMapping("/queryRedMutexDetailPromotionList")
    RestResult<PageResult<CouponConfigQueryResponse>> queryRedMutexDetailPromotionList(@RequestBody PromotionIdRequest promotionIdRequest);

    @PostMapping("/rendRedAdd")
    RestResult<Map<String,Object>> rendRedAdd(@RequestBody CouponGoodsLimitAddRequest couponGoodsLimitAddRequest);

    @PostMapping("/getCouponList")
    RestResult<PageResult<CouponConfigQueryResponse>> getCouponList(@RequestBody CouponConfigQueryRequest couponConfigQueryRequest);

    @PostMapping("/getCouponByPromotionId")
    RestResult<CouponConfigQueryResponse> getCouponByPromotionId(@RequestBody CouponConfigQueryRequest couponConfigQueryRequest);

    @PostMapping("/backstageSendCoupon")
    RestResult<Long> backstageSendCoupon(@RequestBody BackstageSendCouponRequest request);

    @PostMapping("/queryPeriodStatusById")
    RestResult<Integer> queryPeriodStatusById(@RequestBody QueryPeriodStatusByIdRequest request);

    @PostMapping("sendCoupon")
    RestResult<Boolean> sendCoupon(@RequestBody SendCouponRequest couponReceiveOfPersonRequest);

    @PostMapping("/queryMyCouponNumberAndGrouponNumber")
    RestResult<CouponNumAndGrouponNumResponse> queryMyCouponNumberAndGrouponNumber(@RequestBody CouponNumAndGrouponNumRequest request);
}
